displayFormat Property |
String that specifies a special format with which the value can be displayed.
Syntax
HTML |
<ELEMENT id=elementID fieldType="sType" displayFormat=sFormat...>...</ELEMENT> |
Scripting |
elementID.displayFormat [ =sFormat ] |
Parameters
Parameter |
Description |
---|---|
sFormat |
String that denotes the format with which the value can be displayed.locale- Data will be displayed according to system local settings. This is applicable for float and amount field types.
|
Remarks
The displayFormatproperty
can be different for dates with formats other than the shortdate
and longdate
. The various possible formats that are supported are as follows :
date |
D, DD, DDD and DDDD. |
month |
M, MM, MMM and MMMM. |
year |
YY and YYYY. |
For the following display formats only, locale set in CUSP preferences are considered.
|
Unexpected results are expected when the date format is set with the year "YY". It is recommended to have the format as YYYY always. The date separator can be a dot (.), hyphen (-), or forward slash (/) .
Example
The following example shows how the displayFormatproperty
can be used to set the format for various fields.
//validate definition inside the BODY <div cordysType="wcp.library.util.Validate" id="validate" ></div> //INPUT box with fieldType date <input type="text" fieldType="date" displayFormat="DD-MM-YYYY"> //INPUT box with fieldType amount <input type="text" fieldType="amount" displayFormat="locale"> //INPUT box with fieldType date <input type="text" fieldType="date" displayFormat="longdate">